<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-12-17
 * Time: 下午2:09
 */

namespace workin\modules\others\controllers;


use common\models\Custom;
use workin\modules\others\models\FormMultiMediaUpload;
use yii\base\Exception;
use yii\web\Controller;

class BankController extends Controller
{
    /**
     * 11.通用业务多媒体资料补充接口
     */
    public function actionMultiMediaUpload($orderno, $idno)
    {
        $custom = Custom::findOne(['orderno' => $orderno]);
        if (!$custom) {
            throw new Exception("没有找到该订单客户");
        }
        $model = new FormMultiMediaUpload();
        $model->custom_id = $custom->id;
        $model->custom_name = $custom->master_name;
        $model->idno = $idno;
        $request = \Yii::$app->request;
        if ($model->load($request->post())){
            if ($model->validate()){
                $model->addQuene();
                \Yii::$app->session->addFlash('success', "加入上传队列成功");
            }
        }
        return $this->render('multi-media-upload', [
            'model' => $model,
        ]);
    }
}